package me.ilvc.taotao.controller;

import me.ilvc.taotao.model.TbItem;
import me.ilvc.taotao.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * @Author: iLvc
 * @Date：Create in 15:57 2017/7/31
 * @Description:
 * @Modified By:
 */
@Controller
public class indexController {

    @Autowired
    private ItemService itemService;

    @RequestMapping("/admin/index")
    public ModelAndView index(){
        return  new ModelAndView("index");
    }
    @RequestMapping("/admin/item-add")
    public ModelAndView itemadd(){
        return  new ModelAndView("item-add");
    }

    @RequestMapping("/admin/item-edit")
    public ModelAndView itemedit(){
        return  new ModelAndView("item-edit");
    }
    /*item-add*/


    @RequestMapping("/admin/item-list")
    public ModelAndView itemlist(){
        return  new ModelAndView("item-list");
    }
    @RequestMapping("json")
    @ResponseBody
    public TbItem test(){

        return itemService.findById(605616);
    }

}
